package hongcheng.code_generator.entity.db;

import cn.hutool.core.util.StrUtil;

/**
 * 	数据库表字段元数据
 * */
public class TableColumnMetadata {
	/**
	 * 	字段名
	 * */
	private String columnName;
	/**
	 * 	字段注释
	 * */
	private String columnComment;
	/**
	 * 	字段名驼峰写法（首字母小写）
	 * */
	private String columnNameHump;
	/**
	 * 	字段名驼峰写法（首字母大写）
	 * */
	private String columnNameHumpUpFirst;
	/**
	 * 	数据库类型
	 * */
	private String jdbcType;
	/**
	 *  对应java类型,例如String
	 * */
	private String javaType;
	/**
	 *  对应java类名,例如java.lang.String
	 * */
	private String javaClassName;
	
	/****
	 * 	是否是主键
	 * */
	private boolean isPrimaryKey;
	
	
	
	public void setColumnName(String columnName) {
		this.columnName = columnName;
		this.columnNameHump = StrUtil.toCamelCase(columnName.toLowerCase());
		this.columnNameHumpUpFirst = StrUtil.upperFirst(columnNameHump.toLowerCase());
	}


	public void setColumnComment(String columnComment) {
		this.columnComment = columnComment;
	}

	public void setJdbcType(String jdbcType) {
		this.jdbcType = jdbcType;
	}

	public void setJavaClassName(String javaClassName) {
		this.javaClassName = javaClassName;
	}

	public void setJavaType(String javaType) {
		this.javaType = javaType;
	}

	public String getColumnNameHump() {
		return columnNameHump;
	}
	
	public String getJavaClassName() {
		return javaClassName;
	}

	public String getColumnComment() {
		return columnComment;
	}

	public String getColumnName() {
		return columnName;
	}
	
	public String getJavaType() {
		return javaType;
	}
	
	public String getJdbcType() {
		return jdbcType;
	}
	
	
	public String getColumnNameHumpUpFirst() {
		return columnNameHumpUpFirst;
	}

	public boolean getIsPrimaryKey() {
		return isPrimaryKey;
	}

	public void setIsPrimaryKey(boolean isPri) {
		this.isPrimaryKey = isPri;
	}

	@Override
	public String toString() {
		return "TableColumnMetadata [columnName=" + columnName + ", columnComment=" + columnComment
				+ ", columnNameHump=" + columnNameHump + ", columnNameHumpUpFirst=" + columnNameHumpUpFirst
				+ ", jdbcType=" + jdbcType + ", javaType=" + javaType + ", javaClassName=" + javaClassName + ", isPri="
				+ isPrimaryKey + "]";
	}


	
	
	
	
	
	
}
